﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kimd.Motion
{
    public interface ICoordinate
    {
        bool IsError { get; }
        string LastError { get; }
        bool MoveLine2(short cardNo, short crdNo, short axisNo1, short axisNo2, int[] distancesInPulse, AxisSpeed crdSpeed, MoveType moveType = MoveType.Absolute);
        bool MoveLine3(short cardNo, short axisNo1, short axisNo2, short axisNo3, int[] distancesInPulse, AxisSpeed crdSpeed, MoveType moveType = MoveType.Absolute);
        bool MoveArc(short cardNo, short axisNo1, short axisNo2, int[] distancesInPulse, int radiusInpulse, bool isCCW, AxisSpeed crdSpeed);
        void StopCrd(short CardNo, bool now);
        bool MoveBufferLine(short cardNo, short axisNo1, short axisNo2, List<OneMoveSegment> points);
        bool IsCoordinateDone(short cardNo);
        bool IsBufferDone();
        bool CheckApiResult(short rtn, string errMessage);
    }

    public class OneMoveSegment
    {
        public Point XY;
        public int Radius;
        public bool IsCCW;
        public AxisSpeed Speed;
        public bool HasOutput;
        public int OutputNo;
        public bool OutputOn;
        public bool IsArc;
    }
}
